/**
 * amis v6.13.0
 * build time: 2025-08-12
 * Copyright 2018-2025 baidu
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _Slider = require('amis-ui/lib/components/Slider');
var tslib = require('tslib');
var amisCore = require('amis-core');
var React = require('react');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var _Slider__default = /*#__PURE__*/_interopDefaultLegacy(_Slider);
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

var __react_jsx__ = require('react');
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
var _J$F_ = (__react_jsx__["default"] || __react_jsx__).Fragment;


;var SliderRenderer = /** @class */function (_super) {
  tslib.__extends(SliderRenderer, _super);
  function SliderRenderer() {
    var _this = _super !== null && _super.apply(this, arguments) || this;
    _this.state = {
      leftShow: false,
      rightShow: false
    };
    return _this;
  }
  SliderRenderer.prototype.handleLeftShow = function () {
    this.props.dispatchEvent('leftShow', this.props.data);
  };
  SliderRenderer.prototype.handleRightShow = function () {
    this.props.dispatchEvent('rightShow', this.props.data);
  };
  SliderRenderer.prototype.handleLeftHide = function () {
    this.props.dispatchEvent('leftHide', this.props.data);
  };
  SliderRenderer.prototype.handleRightHide = function () {
    this.props.dispatchEvent('rightHide', this.props.data);
  };
  SliderRenderer.prototype.showLeft = function () {
    this.setState({
      leftShow: true
    });
  };
  SliderRenderer.prototype.hideLeft = function () {
    this.setState({
      leftShow: false
    });
  };
  SliderRenderer.prototype.showRight = function () {
    this.setState({
      rightShow: true
    });
  };
  SliderRenderer.prototype.hideRight = function () {
    this.setState({
      rightShow: false
    });
  };
  SliderRenderer.prototype.render = function () {
    var _a = this.props,
      render = _a.render,
      body = _a.body,
      left = _a.left,
      right = _a.right,
      env = _a.env,
      rest = tslib.__rest(_a, ["render", "body", "left", "right", "env"]);
    var _b = this.state,
      leftShow = _b.leftShow,
      rightShow = _b.rightShow;
    return _J$X_(_Slider__default["default"], tslib.__assign({
      body: render('body', body, tslib.__assign({}, rest.data)),
      left: left && render('left', left, tslib.__assign({}, rest.data)),
      right: right && render('right', right, tslib.__assign({}, rest.data)),
      showLeft: leftShow,
      showRight: rightShow,
      onLeftShow: this.handleLeftShow,
      onRightShow: this.handleRightShow,
      onLeftHide: this.handleLeftHide,
      onRightHide: this.handleRightHide
    }, rest));
  };
  tslib.__decorate([amisCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", []), tslib.__metadata("design:returntype", void 0)], SliderRenderer.prototype, "handleLeftShow", null);
  tslib.__decorate([amisCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", []), tslib.__metadata("design:returntype", void 0)], SliderRenderer.prototype, "handleRightShow", null);
  tslib.__decorate([amisCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", []), tslib.__metadata("design:returntype", void 0)], SliderRenderer.prototype, "handleLeftHide", null);
  tslib.__decorate([amisCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", []), tslib.__metadata("design:returntype", void 0)], SliderRenderer.prototype, "handleRightHide", null);
  SliderRenderer = tslib.__decorate([amisCore.Renderer({
    type: 'slider'
  })], SliderRenderer);
  return SliderRenderer;
}(React__default["default"].Component);

exports.SliderRenderer = SliderRenderer;
